require.config({
  baseUrl: "./script/",
  paths: {
    // three: 'script/../../../lib/three'
  },
  shim: {
    'script/../../../lib/three': {
      exports: 'THREE'
    }
  }
})

require(['script/../../../lib/three'], function (THREE) {

  init()
  function init() {
    // 渲染器
    const renderer = new THREE.WebGLRenderer();
    renderer.setSize(400, 300);
    document.body.appendChild(renderer.domElement);
    renderer.setClearColor(0x000000);
    const scene = new THREE.Scene()

    // camera
    const camera = new THREE.OrthographicCamera(-5, 5, 3.75, -3.75, 0.1, 100)
    camera.position.set(25, 25, 25);
    camera.lookAt(new THREE.Vector3(0, 0, 0));
    scene.add(camera);

    // light
    const light = new THREE.PointLight(0xffffff, 1, 200)
    light.position.set(10, 15, 25);
    scene.add(light);

    const material = new THREE.MeshPhongMaterial({
      // color: 0xff0000,
      specular: 0xffff00,
      shininess: 1000
    })

    const sphere = new THREE.Mesh(new THREE.SphereGeometry(3, 20, 8), material)
    scene.add(sphere);

    renderer.render(scene, camera);
  }
})